package com.console.operations.fundmgr;

import org.testng.Assert;

import com.common.test.OperationBase;
import com.common.test.UITestBase;
import com.common.util.DBUtil;
import com.console.pages.fundmgr.*;



public class PersonalWithdraw extends OperationBase {

	public PersonalWithdraw(UITestBase tb){
		super(tb);
	}
	
	public void Trial() throws Exception{
		//进入提现申请页面
		switchToDefaultContent();
		WithdrawMgmtPage wmp = new WithdrawMgmtPage(tb);
		waitForElementExist(wmp.fundmgmtopreration);
		wmp.fundmgmtopreration.click();
		waitForElementExist(wmp.withdrawsplyoperation);
		wmp.withdrawsplyoperation.click();
		waitForElementExist(wmp.personalwithdrawoperation);
		//输入手机号码
		wmp.telephoneinput.type("18082355908");
		pause(3000);
		waitForElementExist(wmp.queryoperation);
		wmp.queryoperation.click();
		//获取页面上的用户名称
		pause(3000);
		String unm = wmp.username.getAttribute("value");
		pause(3000);
		System.out.println("用户名称是："+unm);
		
		//等待
		waitForElementExist(wmp.username);
		//数据库查询用户名     
		String unme=DBUtil.queryOneCell("select vc_name from fiz_user where vc_cellphone=?",new Object[]{"18082355908"});
	    System.out.println("用户名："+unme);
	    //比较用户名是否一致
		Assert.assertEquals(unm,unme);
		//输入提现金额
		waitForElementExist(wmp.withdrawinput);
	    wmp.withdrawinput.type("100000");
	    //提现
	    waitForElementExist(wmp.querysoperation);
	    wmp.queryoperation.click();
	    
	}
}
